<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JS按钮事件绑定</title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<!--ng-app 是angular编程入口，是模块作用域-->
	<body >
		<div ng-app="myapp" ng-controller="myctrl">
			
			
			<table width="100%" border="1">
				<tr>
					<td>商品id</td>
					<td>商品名称</td>
					<td>商品编号</td>
					<td>商品价格</td>
				</tr>
				<tr ng-repeat="product in products">
					<td>{{$index}}</td>
					<td>{{product.name}}</td>
					<td>{{product.id}}</td>
					<td>{{product.price}}</td>
				</tr>
			</table>
			
		</div>		
		
		<script type="text/javascript">
		
			var myapp = angular.module("myapp",[]);
			
			myapp.controller("myctrl",["$scope",function($scope){
				$scope.products=[
					{	id:001,
						name:"冬凌草",
						price:"三钱二分"
					},{	id:001,
						name:"陌上花",
						price:"三钱二分"
					},{ id:001,
						name:"夏子提",
						price:"三钱二分"
					}
				]
			}]);
			
		</script>
		
	</body>
</html>
